/*
 * @description:
 * @author: cuicui
 * @Date: 2023-11-25 12:30:44
 * @LastEditTime: 2023-11-25 23:48:45
 * @LastEditors: cuicui
 */
import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from 'vuex-persistedstate'
import app from './modules/app'
import user from './modules/user'
import menu from './modules/menu'
import dataDicInfo from './modules/dataDicInfo'
import ws from './modules/ws'

// default router permission control
// 默认路由模式为静态路由 (router.config.js)
import permission from './modules/static-router'
import createLogger from 'vuex/dist/logger'

// dynamic router permission control (Experimental)
// 动态路由模式（api请求后端生成）
// import permission from './modules/async-router'
import getters from './getters'

const debug = process.env.NODE_ENV !== 'production'
Vue.use(Vuex)

export default new Vuex.Store({
  modules: {
    app,
    user,
    permission,
    menu,
    ws,
    dataDicInfo
  },
  state: {},
  mutations: {},
  actions: {},
  getters,
  plugins: debug ? [createLogger(), createPersistedState({
    storage: window.sessionStorage
  })] : [createPersistedState({
    storage: window.sessionStorage
  })]
})
